#ifndef _HEALTH_ORBS
#define _HEALTH_ORBS

#include "ISceneNode.h"
#include "../Utils/Utils.h"
#include "../Core/Commons.h"
#include "../PoolManager/Poolmanager.h"
#include "../SceneManager/FpsSceneManager.h"

enum BONUS_TYPE
{
	BONUS_HP,
	BONUS_WEB_POWER,
	BONUS_SKILL_POINT,
};

#define BONUS_RESTORE_HEALTH	20
#define BONUS_RESTORE_WEB		50
#define BONUS_RESTORE_SKILL		10

class CHealthOrbs : public irr::scene::ISceneNode
{
	static irr::video::S3DVertex	Vertices_Green[];
	static irr::video::S3DVertex	Vertices_Red[];
	static irr::u16					Indices[];

	static irr::video::S3DVertex	FrontQuadVertices_Green[];
	static irr::video::S3DVertex	FrontQuadVertices_Red[];
	static irr::u16					FrontQuadIndices[];

	irr::video::SMaterial	Material;

//	irr::video::ITexture			*Tex;
//	irr::video::ITexture			*FrontQuadTexture;

	irr::f32						StartInterval;
	irr::f32						EndInterval;

	irr::f32						orbLength;
	irr::f32						orbWidth;

	irr::f32						animTime;
	irr::u32						timeMs;

	void Hermite(irr::f32 t, irr::core::vector3df &P, irr::core::vector3df &P0, irr::core::vector3df &P1, irr::core::vector3df &T0, irr::core::vector3df &T1);

public:

	irr::core::vector3df			StartPosition;
	irr::core::vector3df			EndPosition;

	irr::core::vector3df			StartTangent;
	irr::core::vector3df			EndTangent;

	CHealthOrbs();
	~CHealthOrbs();

	virtual void Reset();

	virtual const irr::core::aabbox3df&	getBoundingBox() const;
	virtual int		getRenderingLayer() const { return RL_HIT_EFFECTS; };
	virtual void	OnAnimate(irr::u32 timeMs);
	virtual void	OnRegisterSceneNode();
	virtual void	render(void *renderData = 0);

	void	Init(irr::core::vector3df Start, float StartTime, BONUS_TYPE orbType, int amount=0);
//	void	Update(TimeStamp ts);
	bool	isFinished();

	BONUS_TYPE m_type;
	int m_amount;
	bool m_bNeedInitTime;
};

DECLARE_POOL(HealthOrbsPool,CHealthOrbs);
#endif // _HEALTH_ORBS